Optimal. Leaf size=193 \[ -\frac {i (c+d x)^2 \text {ArcTan}\left (e^{i (a+b x)}\right )}{b}+\frac {d^2 \tanh ^{-1}(\sin (a+b x))}{b^3}+\frac {i d (c+d x) \text {PolyLog}\left (2,-i e^{i (a+b x)}\right )}{b^2}-\frac {i d (c+d x) \text {PolyLog}\left (2,i e^{i (a+b x)}\right )}{b^2}-\frac {d^2 \text {PolyLog}\left (3,-i e^{i (a+b x)}\right )}{b^3}+\frac {d^2 \text {PolyLog}\left (3,i e^{i (a+b x)}\right )}{b^3}-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 193, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {4271, 3855,
4266, 2611, 2320, 6724} \begin {gather*} -\frac {i (c+d x)^2 \text {ArcTan}\left (e^{i (a+b x)}\right )}{b}-\frac {d^2 \text {Li}_3\left (-i e^{i (a+b x)}\right )}{b^3}+\frac {d^2 \text {Li}_3\left (i e^{i (a+b x)}\right )}{b^3}+\frac {d^2 \tanh ^{-1}(\sin (a+b x))}{b^3}+\frac {i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \tan (a+b x) \sec (a+b x)}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2320
Rule 2611
Rule 3855
Rule 4266
Rule 4271
Rule 6724
Rubi steps
\begin {align*} \int (c+d x)^2 \sec ^3(a+b x) \, dx &=-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b}+\frac {1}{2} \int (c+d x)^2 \sec (a+b x) \, dx+\frac {d^2 \int \sec (a+b x) \, dx}{b^2}\\ &=-\frac {i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {d^2 \tanh ^{-1}(\sin (a+b x))}{b^3}-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b}-\frac {d \int (c+d x) \log \left (1-i e^{i (a+b x)}\right ) \, dx}{b}+\frac {d \int (c+d x) \log \left (1+i e^{i (a+b x)}\right ) \, dx}{b}\\ &=-\frac {i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {d^2 \tanh ^{-1}(\sin (a+b x))}{b^3}+\frac {i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b}-\frac {\left (i d^2\right ) \int \text {Li}_2\left (-i e^{i (a+b x)}\right ) \, dx}{b^2}+\frac {\left (i d^2\right ) \int \text {Li}_2\left (i e^{i (a+b x)}\right ) \, dx}{b^2}\\ &=-\frac {i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {d^2 \tanh ^{-1}(\sin (a+b x))}{b^3}+\frac {i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b}-\frac {d^2 \text {Subst}\left (\int \frac {\text {Li}_2(-i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}+\frac {d^2 \text {Subst}\left (\int \frac {\text {Li}_2(i x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^3}\\ &=-\frac {i (c+d x)^2 \tan ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {d^2 \tanh ^{-1}(\sin (a+b x))}{b^3}+\frac {i d (c+d x) \text {Li}_2\left (-i e^{i (a+b x)}\right )}{b^2}-\frac {i d (c+d x) \text {Li}_2\left (i e^{i (a+b x)}\right )}{b^2}-\frac {d^2 \text {Li}_3\left (-i e^{i (a+b x)}\right )}{b^3}+\frac {d^2 \text {Li}_3\left (i e^{i (a+b x)}\right )}{b^3}-\frac {d (c+d x) \sec (a+b x)}{b^2}+\frac {(c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.62, size = 184, normalized size = 0.95 \begin {gather*} \frac {-2 i b^2 (c+d x)^2 \text {ArcTan}\left (e^{i (a+b x)}\right )+2 d^2 \tanh ^{-1}(\sin (a+b x))+2 i b d (c+d x) \text {PolyLog}\left (2,-i e^{i (a+b x)}\right )-2 i b d (c+d x) \text {PolyLog}\left (2,i e^{i (a+b x)}\right )-2 d^2 \text {PolyLog}\left (3,-i e^{i (a+b x)}\right )+2 d^2 \text {PolyLog}\left (3,i e^{i (a+b x)}\right )-2 b d (c+d x) \sec (a+b x)+b^2 (c+d x)^2 \sec (a+b x) \tan (a+b x)}{2 b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 583 vs. \(2 (174 ) = 348\).
time = 0.16, size = 584, normalized size = 3.03
method | result | size |
risch | \(\frac {2 i c d a \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {i c d \polylog \left (2, -i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {i d^{2} a^{2} \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {i d^{2} \polylog \left (2, i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {i c^{2} \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}-\frac {d^{2} \polylog \left (3, -i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {a^{2} d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right )}{2 b^{3}}-\frac {c d \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}+\frac {d^{2} \polylog \left (3, i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 i d^{2} \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {i c d \polylog \left (2, i {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {c d \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {c d \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}+\frac {c d \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {a^{2} d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right )}{2 b^{3}}-\frac {i \left (d^{2} x^{2} b \,{\mathrm e}^{3 i \left (b x +a \right )}+2 c d x b \,{\mathrm e}^{3 i \left (b x +a \right )}+c^{2} b \,{\mathrm e}^{3 i \left (b x +a \right )}-d^{2} x^{2} b \,{\mathrm e}^{i \left (b x +a \right )}-2 c d x b \,{\mathrm e}^{i \left (b x +a \right )}-2 i d^{2} x \,{\mathrm e}^{3 i \left (b x +a \right )}-c^{2} b \,{\mathrm e}^{i \left (b x +a \right )}-2 i c d \,{\mathrm e}^{3 i \left (b x +a \right )}-2 i d^{2} x \,{\mathrm e}^{i \left (b x +a \right )}-2 i c d \,{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2} \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )^{2}}+\frac {i d^{2} \polylog \left (2, -i {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {d^{2} \ln \left (1+i {\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{2 b}+\frac {d^{2} \ln \left (1-i {\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{2 b}\) | \(584\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 1891 vs. \(2 (165) = 330\).
time = 0.87, size = 1891, normalized size = 9.80 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 795 vs. \(2 (165) = 330\).
time = 0.44, size = 795, normalized size = 4.12 \begin {gather*} -\frac {2 \, d^{2} \cos \left (b x + a\right )^{2} {\rm polylog}\left (3, i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - 2 \, d^{2} \cos \left (b x + a\right )^{2} {\rm polylog}\left (3, i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 2 \, d^{2} \cos \left (b x + a\right )^{2} {\rm polylog}\left (3, -i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - 2 \, d^{2} \cos \left (b x + a\right )^{2} {\rm polylog}\left (3, -i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} \cos \left (b x + a\right )^{2} {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + 2 \, {\left (i \, b d^{2} x + i \, b c d\right )} \cos \left (b x + a\right )^{2} {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (b x + a\right )^{2} {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + 2 \, {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (b x + a\right )^{2} {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - {\left (b^{2} c^{2} - 2 \, a b c d + {\left (a^{2} + 2\right )} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + {\left (a^{2} + 2\right )} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) - {\left (b^{2} c^{2} - 2 \, a b c d + {\left (a^{2} + 2\right )} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + {\left (a^{2} + 2\right )} d^{2}\right )} \cos \left (b x + a\right )^{2} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + 4 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \sin \left (b x + a\right )}{4 \, b^{3} \cos \left (b x + a\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right )^{2} \sec ^{3}{\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________